﻿@model CmsPagePropertiesContainer

@{
    var items = new CmsPagePropertyItem[2] { new CmsPagePropertyItem(), new CmsPagePropertyItem() };
    if (Model != null && Model.Properties != null)
    {
        Model.Properties = Model.Properties.Concat(items).ToArray();
    }    
}

<ol class="b-form__rows ul-reset g-clear">
@for (int i = 0; i < (Model ?? new CmsPagePropertiesContainer(){Properties = items}).Properties.Length; i++ )
{
    <li class="b-form__row g-clear">
    @Html.LabelFor(m => m.Properties[i].PropertyName, "Name")
    @Html.TextBoxFor(m => m.Properties[i].PropertyName, new {@class="text"})
    @Html.LabelFor(m => m.Properties[i].PropertyValue, "Value")
    @Html.TextBoxFor(m => m.Properties[i].PropertyValue, new { @class = "text" })
    </li>
}
</ol>